import NavBar from '../components/navbar/index.vue'
import TabBar from '../components/tabbar/index.vue'

const routes = [
    {
        path: '/',
        components: {
            default: () => import('../views/home/index.vue'),
            footer: TabBar
        },
        meta: {
            title: '首页',
            icon: 'home-o',
            inMenu: true,
        }
    },
    {
        path: '/category/:id',
        components: {
            header: NavBar,
            default: () => import('../views/category/index.vue'),
            footer: TabBar
        },
        meta: {
            title: '分类',
            icon: 'apps-o',
            inMenu: true,
        }
    },
    {
        path: '/menu',
        components: {
            header: NavBar,
            default: () => import('../views/menu/index.vue'),
            footer: TabBar
        },
        meta: {
            title: '菜谱',
            icon: 'todo-list',
            inMenu: true,
        }
    },
    {
        path: '/cart',
        components: {
            header: NavBar,
            default: () => import('../views/cart/index.vue'),
            footer: TabBar
        },
        meta: {
            title: '购物车',
            icon: 'shopping-cart-o',
            inMenu: true,
        }
    },
    {
        path: '/commit',
        components: {
            default: () => import('../views/cart/commit.vue'),
        },
        meta: {
            title: '提交订单',
        }
    },
    {
        path: '/desk',
        components: {
            default: () => import('../views/cart/desk.vue'),
        },
        meta: {
            title: '收银台',
        }
    },
    {
        path: '/commitFinish',
        components: {
            default: () => import('../views/cart/commitFinish.vue'),
        },
        meta: {
            title: '完成订单',
        }
    },
    {
        path: '/detail',
        components: {
            header:NavBar,
            default: () => import('../views/details/index.vue'),
        },
        meta: {
            title: '商品详情',
        }
    },
    {
        path: '/mine',
        components: {
            header: NavBar,
            default: () => import('../views/mine/index.vue'),
            footer: TabBar
        },
        meta: {
            title: '我的',
            icon: 'user-o',
            inMenu: true,
        },
    },
    {
        path: '/more',
        components: {
            header: NavBar,
            default: () => import('../views/more/index.vue'),
        },
        meta: {
            title: '限时抢购'
        }
    },
    {
        path: '/login',
        components:{
            default:() => import('../views/login/login.vue'),
        } ,
        meta:{
            title:'登录'
        }
    },
    {
        path: '/coupon',
        components:{ 
            default:() => import('../views/mine/coupon.vue'),
        },
        meta:{
            title:'优惠券'
        } 
    },
    {
        path: '/order',
        components: {
            default:() => import('../views/mine/order.vue'),
        },
        meta:{
            title:"订单"
        }
    },
    {
        path:'/order',
        component: () => import('../views/mine/order.vue'),

    },
    {
        path: '/address',
        components: {
            default:() => import('../views/mine/address.vue')
        },
        meta:{
            title:'地址管理'
        }
    },
    {
        path: '/newaddress',
        components: {
            default:() => import('../views/mine/newaddress.vue')
        },
        meta:{
            title:"修改地址"
        }
    },
    {
        path: '/service',
        components:{ 
            default:() => import('../views/mine/service.vue')
        },
        meta:{
            title:'人工服务'
        }
    },
    {
        path: '/news',
        components:{
            default: () => import('../views/mine/news.vue')
        },
        meta:{
            title:"消息"
        }
    },
    {
        path: '/opinion',
        components:{
            default: () => import('../views/mine/opinion.vue')
        },
        meta:{
            title:'意见反馈'
        }
    },
    {
        path: '/setting',
        components:{
            default: () => import('../views/mine/setting.vue'),
        },
        meta:{
            title:'设置'
        }
    },
    {
        path:'/scan',
        components:{
            default:() => import('../views/mine/scan.vue'),
        },
        meta:{
            title:'扫一扫'
        }
    },
    {
        path:'/push',
        components: {
            default:()=>import('../views/mine/push.vue')
        },
        meta:{
            title:'推送设置'
        }
    },
    {
        path:'/score',
        components:{
            default: ()=>import('../views/mine/score.vue')
        },
        meta:{
            title:'积分'
        }

    },
    {
        path: '/detail',
        components: {
            header:NavBar,
            default: () => import('../views/details/index.vue'),
        },
        meta:{
            title:'商品详情'
        }
    },
    {
        path: '/food',
        components: {
            header: NavBar,
            default: () => import('../views/menu/detail.vue'),
        },
        meta: {
            title: '菜单详情'
        }
    },
]

export default routes